package com.roger.homecenterscreen.data.api

import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * 聚合数据IP地址查询API服务
 */
interface LocationApiService {
    
    /**
     * 根据IP地址获取地址信息
     * @param ip IP地址
     * @param key API密钥
     */
    @GET("ip/ipNewV3")
    suspend fun getLocationByIP(
        @Query("ip") ip: String,
        @Query("key") key: String
    ): Response<IpLocationResponse>
}

/**
 * 聚合数据IP地址查询响应
 */
data class IpLocationResponse(
    val error_code: Int,
    val reason: String,
    val result: IpLocationResult?
)

data class IpLocationResult(
    val Country: String?,
    val Province: String?,
    val City: String?,
    val Isp: String?
) 